package com.homework15;

import java.io.File;
import java.util.Scanner;

public class demo {
    public static void main(String[] args) {
        String s = new Scanner(System.in).nextLine();
        File file = new File(s);
        demo1(file);
    }

    private static void demo1(File file) {
        if (file.exists() && file.isDirectory()) {
            File[] files = file.listFiles();
            for (File file1 : files) {
                if (file1.isFile()) {
                    file1.delete();
                } else {
                    demo1(file);
                }
            }
        } else {
            System.out.println("文件不存在或者不是一个文件夹");
        }
    }
}
